package com.durian.affairs.service.impl;

import java.util.List;
import com.durian.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.durian.affairs.mapper.CwPayOrderMapper;
import com.durian.affairs.api.domain.CwPayOrder;
import com.durian.affairs.service.ICwPayOrderService;

/**
 * 支付订单（支付流水信息）Service业务层处理
 * 
 * @author durian
 * @date 2022-06-25
 */
@Service
public class CwPayOrderServiceImpl implements ICwPayOrderService 
{
    @Autowired
    private CwPayOrderMapper cwPayOrderMapper;

    /**
     * 查询支付订单（支付流水信息）
     * 
     * @param id 支付订单（支付流水信息）主键
     * @return 支付订单（支付流水信息）
     */
    @Override
    public CwPayOrder selectCwPayOrderById(Long id)
    {
        return cwPayOrderMapper.selectCwPayOrderById(id);
    }

    /**
     * 查询支付订单（支付流水信息）列表
     * 
     * @param cwPayOrder 支付订单（支付流水信息）
     * @return 支付订单（支付流水信息）
     */
    @Override
    public List<CwPayOrder> selectCwPayOrderList(CwPayOrder cwPayOrder)
    {
        return cwPayOrderMapper.selectCwPayOrderList(cwPayOrder);
    }

    /**
     * 新增支付订单（支付流水信息）
     * 
     * @param cwPayOrder 支付订单（支付流水信息）
     * @return 结果
     */
    @Override
    public int insertCwPayOrder(CwPayOrder cwPayOrder)
    {
        cwPayOrder.setCreateTime(DateUtils.getNowDate());
        return cwPayOrderMapper.insertCwPayOrder(cwPayOrder);
    }

    /**
     * 修改支付订单（支付流水信息）
     * 
     * @param cwPayOrder 支付订单（支付流水信息）
     * @return 结果
     */
    @Override
    public int updateCwPayOrder(CwPayOrder cwPayOrder)
    {
        cwPayOrder.setUpdateTime(DateUtils.getNowDate());
        return cwPayOrderMapper.updateCwPayOrder(cwPayOrder);
    }

    /**
     * 批量删除支付订单（支付流水信息）
     * 
     * @param ids 需要删除的支付订单（支付流水信息）主键
     * @return 结果
     */
    @Override
    public int deleteCwPayOrderByIds(Long[] ids)
    {
        return cwPayOrderMapper.deleteCwPayOrderByIds(ids);
    }

    /**
     * 删除支付订单（支付流水信息）信息
     * 
     * @param id 支付订单（支付流水信息）主键
     * @return 结果
     */
    @Override
    public int deleteCwPayOrderById(Long id)
    {
        return cwPayOrderMapper.deleteCwPayOrderById(id);
    }
}
